% .lbl file:
%lbl_file = '../campus-activities/campus_with_force.lbl';
%lbl_file = '../data/pressure_14_16_21_1.lbl';
%lbl_file = '../data/pressure_14_16_21_4.lbl';
lbl_file = '../data/0309expdata/protocol_without_speed.lbl';
%lbl_file = '../data/0309expdata/protocol_climb_and_walk.lbl';
% .cla file:
%tree_struct_file = '../data/o4.cla';
%tree_struct_file = '../data/0309expdata/down_vs_walkandup.cla';
%tree_struct_file = '../data/0309expdata/walk_vs_upanddown.cla';
tree_struct_file = '../data/0309expdata/nospeed_walk_vs_upanddown.cla';
feature_set = { ...
    'mean:ll/1,ll/2,ll/3', ...
    'mean:rl/1,rl/2,rl/3', ...
    'mean:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'stdev:ll/1,ll/2,ll/3', ...
    'stdev:rl/1,rl/2,rl/3', ...
    'stdev:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'abs_mean:ll/1,ll/2,ll/3', ...
    'abs_mean:rl/1,rl/2,rl/3', ...
    'abs_mean:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'mean_energy:ll/1,ll/2,ll/3', ...
    'mean_energy:rl/1,rl/2,rl/3', ...
    'mean_energy:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'max:ll/1,ll/2,ll/3', ...
    'max:rl/1,rl/2,rl/3', ...
    'max:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'abs_max:ll/1,ll/2,ll/3', ...
    'abs_max:rl/1,rl/2,rl/3', ...
    'abs_max:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'fratio:ll/1,ll/2,ll/3,rl/1,rl/2,rl/3,rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'dpratio:ll/1,ll/2,ll/3,rl/1,rl/2,rl/3,rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'mean_ratio:ll/1,ll/2,ll/3', ...
    'mean_ratio:rl/1,rl/2,rl/3', ...
    'mean_ratio:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'slloc:ll/1,ll/2,ll/3,rl/1,rl/2,rl/3,rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'winsize:ll/1', ...
    'mean_comp:rl/1,rl/2,rl/3',...
    'mean_comp:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'max_comp:rl/1,rl/2,rl/3',...
    'max_comp:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8', ...
    'range:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8',...
    'range:rl/1,rl/2,rl/3',...
    'range_ratio:rforce/1,rforce/2,rforce/3,rforce/4,rforce/5,rforce/6,rforce/7,rforce/8',...
    'range_ratio:rl/1,rl/2,rl/3',...
    ''};

%%
[labels data header] = load_data_with_lbl(lbl_file); 
%%
frames = framing_with_class(labels, data, header);

% read structure of tree and associate frames to classifiers
%%
load(tree_struct_file, '-mat');
%%
assoc_classifiers = assoc_frame_to_classifier(frames, labels, classifiers);

%%
[ feature_vals, feature_set_struct, feature_set_name ] = extract_all_feature( data, header, frames, feature_set, 1 );
classifier_feature_val = combine_feature( feature_vals, frames, assoc_classifiers );
classifier_feature_val = get_feature_param( classifier_feature_val, assoc_classifiers );

%%
analyse_features;
